package edu.byu.intex2.data.bo;

import edu.byu.intex2.data.DataException;
import edu.byu.intex2.data.dao.UsedCarDAO;

/**
 * New Car is a physical car that is not used.
 * @author Brady
 */
public class UsedCar extends PhysicalCar {
    private String carCondition;
    private int mileage;

    /** Creates a new instance of BusinessObject */
    public UsedCar(String id) {
        super(id);
    }//constructor

    /** Convenience method to call the correct DAO to save this business object */
    @Override
    public void save() throws DataException {
        try {
            UsedCarDAO.getInstance().save(this);
        } catch (DataException e) {
            e.printStackTrace();
        }
    }

    /** @return the carCondition     */
    public String getCarCondition() {
        return carCondition;
    }

    /** @param carCondition the carCondition to set     */
    public void setCarCondition(String carCondition) {
        this.carCondition = carCondition;
        setDirty();
    }

    /** @return the mileage     */
    public int getMileage() {
        return mileage;
    }

    /** @param mileage the mileage to set     */
    public void setMileage(int mileage) {
        this.mileage = mileage;
        setDirty();
    }
}
